<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .bb,
    .bb::before,
    .bb::after {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
    }

    .bb {
      width: 631px;
      height: 436px;
      margin: auto;
      background:  rgba(0, 0, 0, 0.1);
      color: #69ca62;
      box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5);
    }

    .bb::before,
    .bb::after {
      content: '';
      z-index: -1;
      margin: -5%;
      box-shadow: inset 0 0 0 2px;
      animation: clipMe 8s linear infinite;
    }

    .bb::before {
      animation-delay: -4s;
    }


    @keyframes clipMe {

      0%,
      100% {
        clip: rect(0px, 651px, 2px, 0px);
      }

      25% {
        clip: rect(0px, 2px, 651px, 0px);
      }

      50% {
        clip: rect(649.0px, 651px, 651px, 0px);
      }

      75% {
        clip: rect(0px, 0, 651px, 649.0px);
      }
    }
  </style>
</head>

<body>
  <div class="bb"></div>
</body>

</html>